/* $Id: SecretQuestionFacadeImpl 
 * Copyright (C) 2011, Trakhees
 *  
 *  History
 *
 * Date  			Author 					Remarks
 * -------------------------------------------------------------
 * May 18, 2011 	Neha_Chauhan 	        Created
 *
 */
package ae.pcfc.etks.online.common.facade.provider;

import java.util.ArrayList;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import ae.pcfc.etks.online.common.domain.SecurityQuestion;
import ae.pcfc.etks.online.common.domain.manager.SecretQuestionDomainObjectManager;
import ae.pcfc.etks.online.common.facade.SecretQuestionFacade;
import ae.pcfc.etks.online.common.vo.SecretQuestionVO;

public class SecretQuestionFacadeImpl extends BaseFacade implements SecretQuestionFacade{
    	/*
	 * Here we coordinate between the all interacting business domain objects
	 * (BO), transactions are maintained here. use case business validation are
	 * maintained here (that requires DB checks or retrieving data from DB)
	 */
	private SecretQuestionDomainObjectManager secretQuestionDomainObjectManager;
	
	/**
	 * setSecretQuestionDomainObjectManager
	 * 
	 * @param secretQuestionDomainObjectManager
	 * void
	 */
	public void setSecretQuestionDomainObjectManager(
			SecretQuestionDomainObjectManager secretQuestionDomainObjectManager) {
		this.secretQuestionDomainObjectManager = secretQuestionDomainObjectManager;
	}


	/**
	 * getSecretQuestionList
	 * 
	 * @see ae.pcfc.etks.online.common.facade.SecretQuestionFacade#getSecretQuestionList()
	 * 
	 */
	@Transactional(readOnly = true)
	public List<SecretQuestionVO> getSecretQuestionList(){
		
    List<SecurityQuestion> secretquestions = secretQuestionDomainObjectManager.getSecretQuestionList();
		
		List<SecretQuestionVO> secretquestionVOs = new ArrayList<SecretQuestionVO>();
		
		SecretQuestionVO secretquestionVO;
		
		for(SecurityQuestion securityquestion:secretquestions)
		{
			secretquestionVO = new SecretQuestionVO();
			getMapper().map(securityquestion,secretquestionVO);	
			
			secretquestionVOs.add(secretquestionVO);
		}
		return secretquestionVOs;
		
	}

}
